<template>
  <div>
    <van-nav-bar title="签到中心" left-text="" :right-text="DutDelete" left-arrow @click-left="onClickLeft"
                 />
    
      <van-calendar
      title=""
      :poppable="false"
      :show-confirm="false"
      type="multiple"
      :min-date="minDate" 
      :default-date="[date]"
      :max-date="maxDate"
      :max-range="3"
      :style="{ height: '500px' }"
    />
  </div>
  <div>
    <van-button type="primary"  @click="qdao"   >点击签到</van-button> 
  </div>

<van-popup v-model:show="show1">{{qtext}}</van-popup>
</template>
<script setup  lang="ts"  >
import { ref } from 'vue';
import {qiandao} from '@/stores/counter';
const onClickLeft = () => history.back();

let qidao=qiandao()
let qtext=ref('签到成功')
console.log(qidao.qian);
let qdao=function(){

if(qidao.qian){
  qidao.qian=false
  qtext.value='签到成功'
  showPopup()
}else{
  qtext.value='已签到明天再来把'
  showPopup()

}
}

  const text = ref('');
 let  minDate=new Date(2022, 9, 1);
  let  maxDate=new Date(2022, 9, 15);
  let date=new Date(2022, 9, 30)
  const show = ref(true); 
  const onConfirm = (dates) => {
    show.value = true;
    text.value = `选择了 ${dates.length} 个日期`;
  };  
  const show1 = ref(false);
  const showPopup = () => {
    show1.value = true;
  }
</script>
<style>
  
</style>
